import * as Sequelize from 'sequelize';
import sequelize from './../core/mysqlDb';

//退换货 商品 列表详情
export interface ReturnInfo {
    id: number;
    returnId :string ;      //退货单号   根据它查
    facilityId:string;      //仓库编码   根据它查
    returnItemSeqId:string; //行项目号
    productCode:string;     //商品编码
    productName:string;     //商品名称
    unit:string;            //单位
    quantity:string ;       //订单数量
    returnQuantity:string ; //退货数量
    changeQuantity:string ; //换货数量
}
export interface ReturnInfostance extends Sequelize.Instance<ReturnInfo>, ReturnInfo {
}
// export const returnInfoModel = sequelize.define<ReturnInfostance, ReturnInfo>('return_info', {
//     returnId:Sequelize.STRING,
//     facilityId:Sequelize.STRING,
//     returnItemSeqId:Sequelize.STRING,
//     productCode:Sequelize.STRING,
//     productName:Sequelize.STRING,
//     unit:Sequelize.STRING,
//     quantity:Sequelize.STRING,
//     returnQuantity:Sequelize.STRING,
//     changeQuantity:Sequelize.STRING
// });

export const returnInfoModel = sequelize.define('return_info', {
    returnId:Sequelize.STRING,
    facilityId:Sequelize.STRING,
    returnItemSeqId:Sequelize.STRING,
    productCode:Sequelize.STRING,
    productName:Sequelize.STRING,
    unit:Sequelize.STRING,
    quantity:Sequelize.STRING,
    returnQuantity:Sequelize.STRING,
    changeQuantity:Sequelize.STRING
});

returnInfoModel.sync();
export default returnInfoModel;
